package com.wmz.springcloud.controller;

import com.wmz.springCloud.common.CommonResult;
import com.wmz.springCloud.entity.Payment;
import com.wmz.springcloud.service.RemotePaymentService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class RemotePaymentController {

    @Autowired
    private RemotePaymentService remotePaymentService;

    @GetMapping("/customer/paymentOK/{id}")
    public CommonResult<Payment> getById(@PathVariable("id") Long id) {
        return remotePaymentService.getFeignOK(id);
    }

    @GetMapping("/customer/paymentTimeOut/{id}")
    public CommonResult<Payment> getByIdTimeOut(@PathVariable("id") Long id) {
        return remotePaymentService.getFeignTimeOut(id);
    }
}
